﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace NicolasLight
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            Loaded += new RoutedEventHandler(MainPage_Loaded);
        }

        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            mainFrame.Navigate(new Uri("Home", UriKind.Relative));
        }

        private void mainFrame_Navigating(object sender, System.Windows.Navigation.NavigatingCancelEventArgs e)
        {
            if (e.Cancel.ToString().ToLower().Contains("RestrictedPage.xaml"))
            {
                e.Cancel = true;
                mainFrame.Navigate(new Uri("RestricedPage.xaml", UriKind.Relative));
            }
        }

        private void hypAbout_Click(object sender, RoutedEventArgs e)
        {
            mainFrame.Navigate(new Uri("Home", UriKind.Relative));
        }

        private void hypPortfolio_Click(object sender, RoutedEventArgs e)
        {
            mainFrame.Navigate(new Uri("Portfolio", UriKind.Relative));
        }

        private void hypServices_Click(object sender, RoutedEventArgs e)
        {
            mainFrame.Navigate(new Uri("Services", UriKind.Relative));
        }

        private void btnLgoNicolas_Click(object sender, RoutedEventArgs e)
        {
            mainFrame.Navigate(new Uri("Home", UriKind.Relative));
        }
    }
}
